package com.cn.qgx428.lazydiary.ui.timeline

import android.app.Activity
import android.content.Context
import android.support.v4.app.FragmentActivity
import android.view.LayoutInflater
import android.view.View

/**
 * Created by qinguanxiong on 2018/4/4.
 *
 * 子类负责加载时间线各个部分数据
 */
abstract class T_Base{

    lateinit var mContext: Context
    var mView: View?

    constructor(context: Context, mView: View?){
        this.mContext = context
        this.mView = mView
        initView()
        initEvent()
        getData()
    }

    abstract fun initView()
    abstract fun initEvent()
    abstract fun getData()
    /**
     * 数据变动，通知更新
     */
    abstract public fun onDataChange()


    fun <T : View> getView(id: Int) = mView!!.findViewById<T>(id)
}